package cn.tedu.spring.dilistmap;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author ruoLi
 */
public class TeacherTest {

    @Test
    public void test1() {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean-listmap.xml");
        Teacher teacher = context.getBean("teacher1", Teacher.class);
        System.out.println(teacher);
    }

    @Test
    public void test2() {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean-dimap.xml");
        Student student = context.getBean("student1", Student.class);
        System.out.println(student);
    }

    @Test
    public void test3(){
        ApplicationContext context=new ClassPathXmlApplicationContext("bean-diref.xml");
        Student student = context.getBean("student", Student.class);
        System.out.println("student = " + student);
    }
    @Test
    public void test4() {
        ApplicationContext context=new ClassPathXmlApplicationContext("bean-diref.xml");
        Student student = context.getBean("student1", Student.class);
        System.out.println("student = " + student);
    }
}
